package com.contiguous.pair.analyser.filereader;

public class CharPair
{
	private char	char0, char1;

	public CharPair(char char0, char char1)
	{
		this.char0 = char0;
		this.char1 = char1;
	}

	public char getChar0()
	{
		return char0;
	}

	public void setChar0(char char0)
	{
		this.char0 = char0;
	}

	public char getChar1()
	{
		return char1;
	}

	public void setChar1(char char1)
	{
		this.char1 = char1;
	}

	@Override
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		sb.append("[");
		sb.append(char0);
		sb.append(",");
		sb.append(char1);
		sb.append("]");
		return sb.toString();
	}

	@Override
	public boolean equals(Object obj)
	{
		if (obj instanceof CharPair)
		{
			CharPair other = (CharPair) obj;
			return char0 == other.char0 & char1 == other.char1;
		}
		return false;
	}

	@Override
	public int hashCode()
	{
		return toString().hashCode();
	}

}
